#include <QRegExpValidator>
#include "meanfilterwindow.h"
#include "ui_meanfilterwindow.h"

MeanFilterWindow::MeanFilterWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MeanFilterWindow)
{
    ui->setupUi(this);
    setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
    ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[0-9]+$")));
}

MeanFilterWindow::~MeanFilterWindow()
{
    delete ui;
}

void MeanFilterWindow::on_horizontalSlider_sliderMoved(int position)
{
    QString num=QString("%1").arg(position);
    ui->lineEdit->setText(num);
}

void MeanFilterWindow::on_pushButton_2_clicked()
{
    this->close();
}

void MeanFilterWindow::on_pushButton_clicked()
{
    sendData(ui->lineEdit->text().toInt());
    this->close();
}


void MeanFilterWindow::on_horizontalSlider_valueChanged(int value)
{
    QString num=QString("%1").arg(value);
    ui->lineEdit->setText(num);
}
